<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>实名认证示范</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="../../plugins/mui/mui.min.css">
    <link rel="stylesheet" type="text/css" href="../../plugins/mui/mui.previewimage.css"/>
    <link rel="stylesheet" href="../../css/my/certification/index.css" />
    <script src="../../js/statistics.js"></script>
</head>
<body>
	<header class="mui-bar mui-bar-nav">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	    <h1 class="mui-title">认证示范</h1>
	</header>
	<div class="mui-content vh">
		<div class="content-card">
			<div class="mui-input-row">
				<label>真实姓名</label>
				<span>张XX</span>
			</div>
			<div class="mui-input-row">
				<label>身份证号</label>
				<span>32048XXXXXXXXXXXXX</span>
			</div>
			<div class="card">
				<p class="card-tit">身份证照（正面）</p>
				<div class="card-img-box">
					<img src="../../images/my/index/ex-front.jpg" data-preview-src="" data-preview-group="1"/>
				</div>
			</div>
			<div class="card">
				<p class="card-tit">身份证照（反面）</p>
				<div class="card-img-box">
					<img src="../../images/my/index/ex-back.jpg" data-preview-src="" data-preview-group="1"/>
				</div>
			</div>
			<div class="card">
				<p class="card-tit">手持身份证照</p>
				<div class="card-img-box center">
					<img src="../../images/my/index/ex-main.jpg" class="img-response" data-preview-src="" data-preview-group="1"/>
				</div>
			</div>
		</div>
		<div class="btn-box">
			<button class="mui-btn mui-btn-suceess mui-hidden" id="submitBtn"></button>
		</div>
	</div>

<script type="text/javascript" src='../../plugins/jquery/jquery-3.1.0.min.js'></script>
<script src="../../plugins/mui/mui.min.js"></script>
<script src="../../plugins/mui/mui.zoom.js"></script>
<script src="../../plugins/mui/mui.previewimage.js" ></script>
<script src="../../js/getApiToken.js"></script>
<script src="../../js/md5.js"></script>
<script type="text/javascript">
	mui.init();
	mui.plusReady(function(){
		mui.previewImage();
		var submitBtn = document.getElementById("submitBtn"),
		html,url;
		if(plus.storage.getItem('cg_certification')!=1){
			myAjax('personal/user_profile/getselfprofile', 'get', {
				'user_id': plus.storage.getItem('cg_user_id'),
				'user_token': plus.storage.getItem('cg_user_token')
			}, function(data) {
				plus.nativeUI.closeWaiting();
				if(!data.success){
					plus.nativeUI.alert(data.error_msg, function() {
						mui.back();
					}, "错误", "确定");
					return ;//发生错误 就直接退出
				}
				plus.storage.setItem('cg_certification', data.certification);
				var main = plus.webview.getWebviewById('my-1.html');
				if(main){
					mui.fire(main, "certification",{});
				}	
				var certification = plus.storage.getItem('cg_certification') ;
				if(certification == -1){
					html = '实名认证';
					url = 'user-4.html';
				}else {
					html = '查看进度';
					url = 'user-9.html';
				}
				submitBtn.innerHTML = html;
				submitBtn.classList.remove('mui-hidden');
				submitBtn.addEventListener('tap',function(){
					mui.openWindow({
						url:url ,
						id: url,
						show: {
							duration: 200 //页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
						},
						waiting: {
							title: '正在加载...' //等待对话框上显示的提示内容
						}
					})
				},false);
			});
		}else{
			html = '查看进度';
			url = 'user-9.html';
			submitBtn.innerHTML = html;
			submitBtn.classList.remove('mui-hidden');
			submitBtn.addEventListener('tap',function(){
				mui.openWindow({
					url:url ,
					id: url,
					show: {
						duration: 200 //页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
					},
					waiting: {
						title: '正在加载...' //等待对话框上显示的提示内容
					}
				})
			},false);
		}
		
	})
</script>
</body>
</html>
